<script setup lang="ts">
import MyNav from "@b/nav.vue";
import MyContainer from "@b/container.vue";
import MySidebar from "@b/sidebar.vue";
import MyMain from "@b/main.vue";
import { onMounted, watch } from "vue";
import { useChatStore } from "@s/chat.ts";
import { storeToRefs } from "pinia";
import { showloading, hideloading } from "@u/index.ts";
const chat = useChatStore();
const { userstatus } = storeToRefs(chat);
watch(userstatus, (val) => {
  if (val === 0) {
    // ElMessageBox({
    //   title: "提示",
    //   message: "请登录后使用",
    //   confirmButtonText: "确认",
    //   callback:function() {
    //     window.location.href = "/login";
    //   }
    // });
  }});
onMounted(async () => {
  await chat.init();
});
</script>
<template>
  <div class="container-scroller">
    <my-nav></my-nav>
    <my-container>
      <template #left>
        <my-sidebar></my-sidebar>
      </template>
      <template #right>
        <my-main></my-main>
      </template>
    </my-container>
  </div>
</template>
